package com.example.websocketproject.service;

import com.example.websocketproject.domain.CharRoom;
import com.example.websocketproject.mapper.CharRoomMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 吴 da ~
 * @data 2021/3/4 15:13
 */
@Service
public class CharService {

    @Autowired
    CharRoomMapper charRoomMapper;

    public List chechInfo() {
        return charRoomMapper.checkList();
    }

    public String addRoom(CharRoom charRoom) {
        charRoomMapper.insert(charRoom);
        return "添加成功";
    }

    public String delRoom(CharRoom charRoom) {
        charRoomMapper.deleteByPrimaryKey(charRoom.getId());
        return "删除成功";
    }
}
